package org.rency.ues.common.enums;

import org.apache.commons.lang.StringUtils;

/**
 * 密钥类型
 * @author: Created by user_rcy@163.com on 2016/7/26.
 */
public enum TicketKind {

    P("P","SEQ_P_TICKET_NO"),
    C("C","SEQ_C_TICKET_NO"),
    ;

    private String code;

    private String seqName;

    TicketKind(String code,String seqName){
        this.code = code;
        this.seqName = seqName;
    }

    public String getCode(){
        return this.code;
    }

    public String getSeqName() {
        return seqName;
    }

    public static TicketKind get(String code){
        if(StringUtils.isBlank(code)){
            return null;
        }
        for(TicketKind en : TicketKind.values()){
            if(code.equalsIgnoreCase(en.getCode())){
                return en;
            }
        }
        return null;
    }
}